﻿using Common.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Database.Mappers
{
    public partial class Mapper
    {
        public IslandDTO Map(Island island)
        {
            if (island == null)
                return null;

            var islandDTO = new IslandDTO 
            {
                Id = island.Id,
                Places = Map(island.Places)
            };
            islandDTO.IslandQues = Map(island.IslandQues, islandDTO);

            return islandDTO;
        }

        public Island Map(IslandDTO island)
        {
            if (island == null)
                return null;

            return new Island
            {
                Places = Map(island.Places ?? null)
            };
        }
    }
}
